package com.example.system.manager;

import com.example.common.core.constants.CacheConstants;
import com.example.common.redis.RedisService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * @author 23050
 * @version 1.0
 * @description: TODO
 * @date 2025/3/27 21:09
 */
@Component
public class QuestionCacheManager {

    @Resource
    private RedisService redisService;

    //从Redis列表中添加题目
    public void addCache(Long questionId){
        redisService.leftPushForList(CacheConstants.QUESTION_LIST,questionId);
    }


    //从Redis列表中删除题目
    public void deleteCache(Long questionId){
        redisService.removeForList(CacheConstants.QUESTION_LIST,questionId);
    }



}
